import Vue from 'vue'
import store from './store/index'
import App from './views/App.vue'
import router from './router/index'
import asyncRouter from './router/asyncRouter'
import './plugins/index'
import './styles/index'

// 设置菜单和面包屑数据
store.dispatch('menu/SET_PURE_ROUTER', asyncRouter).then(() => {
  store.commit('menu/SET_SIDEBAR_MENU')
  store.commit('menu/SET_BREADCRUMB')
})
router.addRoutes(asyncRouter)

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
